<!-- Xu ly load am thanh. -->

<script type="text/javascript">
    // Global variable to track current file name.
    var currentFile = "";
    function playAudio() {
        // Check for audio element support.
        if (window.HTMLAudioElement) {
            try {
                var oAudio = document.getElementById('myaudio');
                var btn = document.getElementById('play'); 

                // Tests the paused attribute and set state. 
                btn.textContent = "Play";
                if (oAudio.paused) {
                    oAudio.play();
                    btn.textContent = "Pause";
                }
                else {
                    oAudio.pause();
                    btn.textContent = "Play";
                }
                    
                    
            }
            catch (e) {
                // Fail silently but show in F12 developer tools console
                if(window.console && console.error("Error:" + e));
            }
        }
    }
    
    function playAudioEx() {
        // Check for audio element support.
        if (window.HTMLAudioElement) {
            try {
                var oAudio = document.getElementById('myaudioex');
                var btn = document.getElementById('play'); 

                // Tests the paused attribute and set state. 
                btn.textContent = "Play";
                if (oAudio.paused) {
                    oAudio.play();
                    btn.textContent = "Pause";
                }
                else {
                    oAudio.pause();
                    btn.textContent = "Play";
                }
                    
                    
            }
            catch (e) {
                // Fail silently but show in F12 developer tools console
                if(window.console && console.error("Error:" + e));
            }
        }
    }
</script>

<!-- Xu ly Click chon tu --> 
<script type="text/javascript" language="javascript">
    
    function CreateXMLHttpRequest()
    {
        if ( window.XMLHttpRequest )
        {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            return new XMLHttpRequest()
        }
        else if (window.ActiveXObject )
        {
            // code for IE6, IE5
            return new ActiveXObject("Microsoft.XMLHTTP")
        }
    }
    
    function ClickWord(id)
    {
        var xmlHttp;
        xmlHttp = CreateXMLHttpRequest();
        xmlHttp.onreadystatechange = function()
        {
            if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
            {
                var kq = xmlHttp.responseText;
			
                document.getElementById("OneVocabulary").innerHTML = kq;
            }
        }
        
        var serverURL =  'loadWord?id='+id+'&t=' + (new Date()).getTime();
		
        xmlHttp.open("get", serverURL, true);
		
        xmlHttp.send(null);
    }
    
  
    
</script>

<!-- Xu li hinh anh -->
<link type='text/css' rel='stylesheet' href='<?php echo elgg_get_site_url(); ?>mod/MyCourse/css/liquidcarousel.css' />
<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/js/jquery.liquidcarousel.pack.js"></script>
<script type="text/javascript">
    <!--
    $(document).ready(function() {
        $('#liquid1').liquidcarousel({height:50, duration:100, hidearrows:false});
    });
    -->
</script>





<div id="ListVocabulary">
    <?php
    session_start();

    function fixObject(&$object) {
        if (!is_object($object) && gettype($object) == 'object')
            return ($object = unserialize(serialize($object)));
        return $object;
    }

    $result = Array();
    $temp = new Word();

    $result = fixObject($_SESSION["WordsResult"]);
    if (!session_is_registered("WordsResult")) {
        system_message("Session of Words can not receive");
    }
    ?>
    <ul>
        <?php
        for ($i = 0; $i < count($result); ++$i) {
            $temp = fixObject($result[$i]);
            ?>
            <li><a href="#" onclick='ClickWord(<?php echo $temp->id; ?>);'><b> <?php echo $temp->engName; ?></b></a></li>
        <?php } ?>
    </ul>
</div> <!-- end ListVocabulary -->



    <div id="liquid1" class="liquid" style='height: 80px;'>
        <span class="previous">
            <img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/previous.png" style="height: 70px;"/>
        </span>
        <div class="wrapper">
            <ul>
                <li><a href="#" title="image 01"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/moimages/01.jpg" alt="image 01" border="0" /></a></li>
                <li><a href="#" title="image 02"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/02.jpg" alt="image 02" border="0" /></a></li>
                <li><a href="#" title="image 03"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/03.jpg" alt="image 03" border="0" /></a></li>
                <li><a href="#" title="image 04"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/04.jpg" alt="image 04" border="0" /></a></li>
                <li><a href="#" title="image 05"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/05.jpg" alt="image 05" border="0" /></a></li>
                <li><a href="#" title="image 06"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/06.jpg" alt="image 06" border="0" /></a></li>
                <li><a href="#" title="image 07"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/07.jpg" alt="image 07" border="0" /></a></li>
                <li><a href="#" title="image 08"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/08.jpg" alt="image 08" border="0" /></a></li>
                <li><a href="#" title="image 09"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/09.jpg" alt="image 09" border="0" /></a></li>
                <li><a href="#" title="image 10"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/10.jpg" alt="image 10" border="0" /></a></li>
                <li><a href="#" title="image 11"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/11.jpg" alt="image 11" border="0" /></a></li>
                <li><a href="#" title="image 12"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/12.jpg" alt="image 12" border="0" /></a></li>
                <li><a href="#" title="image 13"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/13.jpg" alt="image 13" border="0" /></a></li>
                <li><a href="#" title="image 14"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/14.jpg" alt="image 14" border="0" /></a></li>
                <li><a href="#" title="image 15"><img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/15.jpg" alt="image 15" border="0" /></a></li>
            </ul>
        </div>
        <span class="next">
            <img src="<?php echo elgg_get_site_url(); ?>mod/MyCourse/images/next.png" style="height: 70px;"/>
        </span>
    </div>


<div id="OneVocabulary">
</div>
<!-- end OneVocabulary -->